# -*- coding: utf-8 -*-
from django.conf.urls.defaults import *
from ragendja.urlsauto import urlpatterns
from ragendja.auth.urls import urlpatterns as auth_patterns
#from myapp.forms import UserRegistrationForm
from django.contrib import admin

from django.contrib.auth import views as auth_views
from haco import views as haco_views
from haco.forms import UserRegistrationForm

admin.autodiscover()

handler500 = 'ragendja.views.server_error'

urlpatterns = auth_patterns + patterns(
    '',
    ('^admin/(.*)', admin.site.root),
    #(r'^$', 'django.views.generic.simple.direct_to_template',
    #    {'template': 'main.html'}),
    # Override the default registration form
    url(r'^account/register/$', 'registration.views.register',
        kwargs={'form_class': UserRegistrationForm},
        name='registration_register'),
    
    #url(r'^$', 'haco.views.login'),

    url( r'^$', 
         auth_views.login, 
         {'template_name': 'registration/login.html'}, 
         name='auth_login'),

    (r'^accounts/change-password/$', 'django.contrib.auth.views.password_change',
    {'post_change_redirect': '/'}),
    
    (r'^haco/', include( 'haco.urls')),

    ) + urlpatterns
